home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / icon / packages.lha / packages / atari / ats.arc / TESTS.ARC / DIFFWRDS.ICN < prev    next >
Text File  |  1990-03-28  |  373b  |  16 lines

  1. #
  2. #          D I F F E R E N T   W O R D S
  3. #
  4.  
  5. #  This program lists all the different words in the input text.
  6. #  The definition of a "word" is naive.
  7.  
  8. procedure main()
  9.    letter := &lcase ++ &ucase
  10.    words := set()
  11.    while text := read() do
  12.       text ? while tab(upto(letter)) do
  13.          insert(words,tab(many(letter)))
  14.    every write(!sort(words))
  15. end
  16.